import MySQLdb
import _mysql_exceptions
cxn=MySQLdb.connect(db='servicecom',host='192.168.161.148',user='root',passwd='root')
cxn.set_character_set('utf8')
cur=cxn.cursor()

sql='select id,Addr,Name from servicecom_store limit 5'

cur.execute(sql)
for record in cur.fetchall():
    print 'Addr:%s;Name:%s'%(record[1],record[2])
    #print record[0].decode('gbk')
    print record[1].decode('utf-8')
    sql='update servicecom_store SET Score=1 WHERE id =%s'
    cur.execute(sql,(1,))
    a=raw_input('input:')
cxn.commit()
cur.close()
cxn.close()

